﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ArgusControls
{
	public class ClippingGrid : Grid
	{
		public ClippingGrid()
			:base()
		{
			this.Clip = new RectangleGeometry()
			{
				Rect = new Rect(0, 0, this.Width, this.Height)
			};
			this.SizeChanged += ClippingCanvas_SizeChanged;
		}

		void ClippingCanvas_SizeChanged(object sender, SizeChangedEventArgs e)
		{
			this.Clip = new RectangleGeometry()
			{
				Rect = new Rect(new Point(0, 0), e.NewSize)
			};
		}
	}
}
